<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<div>
	<a href="index.jsp">首页</a>
	
	<!-- 根据用户是否登录, 显示不同的内容 -->
	<c:if test="${sessionScope.user == null }">
		<a href="login.jsp">登录</a>
	</c:if>
	
	<c:if test="${sessionScope.user != null }">
		<a href="uploadPhoto.jsp">
		<c:if test="${sessionScope.user.photo==null }">
			<img src="img/default_photo.jpg" width="40px">
		</c:if>
		<c:if test="${sessionScope.user.photo!=null }">
			<img src="upload/${sessionScope.user.photo }" width="40px">
		</c:if>
		</a>
		
		<span>${sessionScope.user.username }</span>
		<a href="modifyPwd.jsp">修改密码</a>
		<a href="user.do?action=logout">退出</a>
	</c:if>
	
	<!-- 显示当前在线人数 -->
	<span>当前在线人数:${applicationScope.onlineCount }人</span>-
	<span>当前登录用户:${applicationScope.loginCount }人</span>
</div>